<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<title>医患对话数据集生成器</title>
<style>
body{font-family:Arial,Helvetica,sans-serif;margin:40px;background:#f7f7f7;}
h1{color:#036;}
button{margin:8px 4px;padding:8px 14px;font-size:14px;}
pre{background:#fff;border:1px solid #ccc;padding:12px;white-space:pre-wrap;max-height:400px;overflow:auto;}
</style>
</head>
<body>
<h1>医患对话数据集生成器</h1>
<button onclick="fetchData()">生成10条对话（JSON）</button>
<button onclick="downloadCSV()">导出CSV</button>
<pre id="output">点击按钮生成数据……</pre>
<script>
async function fetchData(){
  const res=await fetch("http://localhost:8080/api/dialogs");
  const data=await res.json();
  document.getElementById("output").textContent=JSON.stringify(data,null,2);
}
function downloadCSV(){
  location.href="http://localhost:8080/api/dialogs.csv";
}
</script>
</body>
</html>
